<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<div class="widget-box">
	<div class="widget-header header-color-pink">
		<h5>
			<i class="icon-edit"></i>数字雨量计
		</h5>
		<button style="float:right;margin-top:5px;margin-right:5px;" id="export" onclick="exportExcel('/export/rain');" class="btn btn-xs bigger btn-yellow dropdown-toggle">
			<i class="icon-download-alt"> 导出Excel</i>
		</button>

		<!-- <div class="widget-toolbar no-border">
			<button id="back" class="btn btn-xs btn-yellow bigger" onclick="trans2('/sensor/level');">
				<i class="icon-arrow-left"></i> 返回
			</button>
		</div> -->
	</div>

	<div class="widget-body">
		<div class="widget-main">

			<form class="form-horizontal" id="rainForm" action="" method="post">

				<div class="space-4"></div>

				<div class="form-group">
					<label class="col-sm-2 control-label no-padding-right"> 编号 </label>
					<div class="col-sm-3">
						<input type="text" name="code" id="code" value="${rain.code}" placeholder="传感器编号 必填" class="col-xs-5 col-sm-12" />
					</div>

					<label class="col-sm-2 control-label no-padding-right"> 名称 </label>
					<div class="col-sm-3">
						<input type="text" name="name" id="name" value="${rain.name}" placeholder="传感器名称 必填" class="col-xs-5 col-sm-12" />
					</div>
				</div>

				<div class="form-group">
					<label class="col-sm-2 control-label no-padding-right"> 状态 </label>
					<div class="col-sm-3">
						<select name="state" id="state" class="col-xs-5 col-sm-12 required" title="必选">
							<option value="0" <c:if test="${rain.state==0}">selected="selected"</c:if>>启用</option>
							<option value="1" <c:if test="${rain.state==1}">selected="selected"</c:if>>禁用</option>
						</select>
					</div>
					<label class="col-sm-2 control-label no-padding-right"> 通信状态</label>
					<div class="col-sm-3">
						<input type="text" value="<c:if test="${rain.info==0}">正常</c:if><c:if test="${rain.info!=0}">断线</c:if>" class="col-xs-5 col-sm-12" readonly="readonly" />
					</div>
				</div>
				
				<div class="form-group">
					<label class="col-sm-2 control-label no-padding-right"> 安装位置 </label>
					<div class="col-sm-3">
						<input type="text" name="pxy" id="pxy" readonly="readonly" value="${rain.pxy}" placeholder="安装位置 必填" class="col-xs-5 col-sm-12" />
					</div>
					
					<label class="col-sm-2 control-label no-padding-right"> 雨量上限报警参数(mm) </label>
					<div class="col-sm-3">
						<input type="text" name=alertval id="level2" value="${rain.alertval}" placeholder="雨量上限报警参数 必填" class="col-xs-5 col-sm-12" />
					</div>

				</div>

				<div class="clearfix form-actions">
					<c:if test="${sessionScope['ABKJ-PT-ACCOUNT'].type ==1}">
						<div class="col-md-offset-3 col-md-9">
							<button class="btn btn-info" type="button" onclick="form_submit('rainForm','/sensor/rain_saveOrUpdate', '监测点管理-数字雨量计');">
								<i class="icon-ok bigger-110"></i> 保存
							</button>
							&nbsp;
							<button class="btn btn-info" type="button" onclick="confirmRainTimeBox(1);">
								<i class="icon-ok bigger-110"></i> 设置雨量计时间
							</button>
							&nbsp;
							<button class="btn btn-info" type="button" onclick="confirmRainTimeBox(2);">
								<i class="icon-ok bigger-110"></i> 读取雨量计时间
							</button>
						</div>
					</c:if>
				</div>

				<input id="id" type="hidden" name="id" value="${rain.id}" />
			</form>

		</div>

	</div>
</div>
<script type="text/javascript">
	function exportExcel(urlStr){
		var url = "/tail/" + urlStr;
		window.open(url);
	}
</script>
<jsp:include page="../../pxy.jsp"></jsp:include>
